package nc.bs.gsp.hf054420;

import java.util.Collection;

import nc.bs.medpub.pub.MedPubDMO;
import nc.bs.medpub.pub.MedQueryDMO;
import nc.bs.pub.pf.IQueryData;
import nc.bs.pub.pf.IQueryData2;
import nc.bs.pub.pf.QueryVoContext;
import nc.vo.gsp.hf054420.BHGXHSQHeadVO;
import nc.vo.gsp.pub.GspConst;
import nc.vo.jcom.lang.StringUtil;
import nc.vo.pub.BusinessException;
import nc.vo.pub.CircularlyAccessibleValueObject;

public class GspBhgxhsqDMO extends MedQueryDMO implements IQueryData, IQueryData2{

	public CircularlyAccessibleValueObject[] queryAllBodyData(String key)
			throws BusinessException {
		// TODO Auto-generated method stub
		return null;
	}

	public CircularlyAccessibleValueObject[] queryAllHeadData(String whereString)
			throws BusinessException {

		String strWhere = " nvl(dr,0)=0 ";
		if (!StringUtil.isEmptyWithTrim(whereString)) {
			strWhere += " and (" + whereString + ")";
		}
		Collection rs = getDao().retrieveByClause(BHGXHSQHeadVO.class,
				strWhere);
		if (rs != null && !rs.isEmpty()) {
			return (BHGXHSQHeadVO[]) rs.toArray(new BHGXHSQHeadVO[0]);
		}
		return null;
	}

	public CircularlyAccessibleValueObject[] queryAllBodyData(String key,
			String whereString) throws BusinessException {
		// TODO Auto-generated method stub
		return null;
	}
	@Override
	protected String getBillType() {
		return  GspConst.BHGXHSQ;
	}
	public Object queryHeadVO(QueryVoContext qvc) throws BusinessException {
		
		return nc.vo.gsp.hf054420.BHGXHSQHeadVO.class;
	}

	public Object queryBodyVO(QueryVoContext qvc) throws BusinessException {
		
		return nc.vo.gsp.hf054420.BHGXHSQHeadVO.class;
	}
}
